package shouhu;

public class Test {
    public static void main(String[] args) {

        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println(Thread.currentThread().getName() + "正在唱歌" + i);
                }
                System.out.println(Thread.currentThread().getName() + "唱歌结束");




            }
        }, "韩红");

        thread.start();


        Thread thread1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println(Thread.currentThread().getName() + "正在跳舞" + i);

                }
            }
        }, "舞伴1号--");

        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println(Thread.currentThread().getName() + "正在跳舞" + i);

                }
            }
        }, "舞伴2号--");

        Thread thread3 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println(Thread.currentThread().getName() + "正在跳舞"+i);

                }

            }
        }, "舞伴3号--");

        thread1.setDaemon(true);
        thread2.setDaemon(true);
        thread3.setDaemon(true);


        thread1.start();
        thread2.start();
        thread3.start();




    }
}
